package com.bean;

import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class AvgTemp implements Writable {
    private int num;
    private int sum;

    public AvgTemp() {
    }

    public AvgTemp(int num, int sum) {
        this.num = num;
        this.sum = sum;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public int getSum() {
        return sum;
    }

    public void setSum(int sum) {
        this.sum = sum;
    }

    @Override
    public String toString() {
        return "AvgTemp{" +
                "num=" + num +
                ", sum=" + sum +
                '}';
    }

    @Override
    public void write(DataOutput out) throws IOException {
        out.writeInt(num);
        out.writeInt(sum);
    }

    @Override
    public void readFields(DataInput in) throws IOException {
        this.num = in.readInt();
        this.sum = in.readInt();
    }
}
